"use strict";
const requireEx=require('yi-require');

const handler = (req,res,next)=>{
    let qrId = req.body.qrId;
    let qrCodeType = req.body.qrCodeType;

    req.redis.get('QrCode'+qrCodeType+':'+qrId,(e,r)=>{
        if(e)
            return res.reply({code:5002,message:'获取扫码信息失败'});
        else{
            if(r){
                res.reply({code:0,message:'扫码授权成功',data:JSON.parse(r)});
            }else{
                res.reply({code:5003,message:'未获取到扫码信息或已过期'});
            }
        }
    });

}

module.exports = {
    open:true,
    description: '二维码扫码授权',
    handler: handler
};
